<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'api';
$return=array();
if($_RQ['op']=='api'){
	$polyapi_plugin = $this->plugin_setting('basic');
	if (!$polyapi_plugin['appkey'] || !$polyapi_plugin['appsecret'] || !$polyapi_plugin['token']) {
		exi('请先填写相关接口参数！','error');
	}
	$array = array();
	$array['appkey'] = trim($_RQ['appkey']);
	$array['bizcontent'] = $_RQ['bizcontent'];
	$array['method'] = trim($_RQ['method']);
	$array['token'] = trim($_RQ['token']);
	$array['sign'] = trim($_RQ['sign']);
	$this->check_request($array);
	$array['bizcontent'] = html_entity_decode($array['bizcontent']);
	if (empty($polyapi_plugin['status'])) {
		exi('接口已经关闭,请到商城中开启接口!','error');
	}
	 else {
		$this->check_sign($array, $polyapi_plugin);
	}

	$array['uniacid'] = $_SESSION['uniacid'];
	$array['bizcontent'] = json_decode($array['bizcontent'], true);

	switch ($array['method']) {
	case 'Differ.JH.Business.GetOrder':
		$data = $this->GetOrder($array);
		break;

	case 'Differ.JH.Business.CheckRefundStatus':
		$data = $this->CheckRefundStatus($array);
		break;

	case 'Differ.JH.Business.Send':
		$data = $this->Send($array);
		break;

	case 'Differ.JH.Business.DownloadProduct':
		$data = $this->DownloadProduct($array);
		break;

	case 'Differ.JH.Business.SyncStock':
		$data = $this->SyncStock($array);
		break;

		exi('平台不支持此接口', 'error');
	}

	$data = json_encode($data);
	exi($data);
}
?>